/*
 * @Author: jqm123 2289662078@qq.com
 * @Date: 2025-06-10 15:02:14
 * @LastEditors: jqm123 2289662078@qq.com
 * @LastEditTime: 2025-08-08 09:29:30
 * @FilePath: /anxinxiu/src/api/modules/order.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from "@/utils/request";

const module = {
  //订单列表
  orderList: (params) =>
    request({
      method: "get",
      params,
      url: "/order/page",
    }),
  //订单详情
  orderDetail: (params) =>
    request({
      method: "get",
      params,
      url: "/order/detail",
    }),
  //发起退款
  refund: (data) =>
    request({
      method: "post",
      data,
      url: "/afterSale/save",
    }),
  //获取退款原因
  getRefundReson: (params) =>
    request({
      method: "get",
      params,
      url: "/afterSale/afterSaleReason",
    }),
  //评价订单
  evaluateOrder: (data) =>
    request({
      method: "post",
      data,
      url: "/order/batchEvaluate",
    }),
  //取消订单
  cancleOrder: (data) =>
    request({
      method: "post",
      data,
      url: "/order/cancel",
    }),
  //券码
  getTicket: (params) =>
    request({
      method: "get",
      params,
      url: "/order/item/ticket",
    }),
  //券码详情
  getTicketDetail: (data) =>
    request({
      method: "post",
      data,
      url: "/writeoff/ticket",
    }),
  //核销
  takeWriteOff: (data) =>
    request({
      method: "post",
      data,
      url: "/writeoff/take",
    }),
  //摄像头列表
  getCameraList: (params) =>
    request({
      method: "get",
      params,
      url: "/camera/list",
    }),
  //摄像头详情
  getCamreaDetail: (params) =>
    request({
      method: "get",
      params,
      url: "/camera/detail",
    }),
  //售后列表
  getAfterSalePage: (params) =>
    request({
      method: "get",
      params,
      url: "/afterSale/page",
    }),
  //申请售后后订单信息
  getAfterSaleInfo: (params) =>
    request({
      method: "get",
      params,
      url: "/afterSale/detail",
    }),
  //取消售后
  cancelAfterSale: (params) =>
    request({
      method: "get",
      params,
      url: "/afterSale/cancel",
    }),
};

export default module;
